
define(["jquery"],function($){
  /**
   * 页面向导.
   * <p>
   * 页面的跳转.
   * </p>
   */
  function Wizard() {

  }
  /**
   * 绘制主页面.
   */
  Wizard.gotoPg00=Wizard.gotoPg00Home=function(){
    console.log("goto page 00");
    require(["pg.home"],function(fn){
      $(function(){
        var settings = {};
        try{
          fn.call($("body"),settings);
        }catch(e){
          console.log(e)
        }
      });
    });
  }
  
  Wizard.gotoPg01=Wizard.gotoPg01Home=function(){
	  console.log("goto page 01");
	  require(["pg.home1"],function(fn){
		  $(function(){
			  var settings={};
			  try{
				  fn.call($("body"),settings);
			  }
			  catch(e){
				  console.log(e);
			  }
		  });
	  });
  }
  
  
  Wizard.gotoWorkshop=function(){
    console.log("goto Workshop");
    require(["pg.workshop"],function(fn){
      $(function(){
        var settings = {};
        try{
          fn.call($("body"),settings);
        }catch(e){
          console.log(e)
        }
      });
    });
  }

  Wizard.switch2OrderDetail=function(page){
      var order = page.order;
      if(!order){
	  return;
      }

      page.houseKeeping();
      $(page).trigger({type:"composeOrder",order:order});

  }
  
  Wizard.switch2GoodsDetail=function(page,goods){
    page.houseKeeping();
    $(page).trigger({type:"composeGoodsDetail",goods:goods});
  }
  
  
  Wizard.switch2AddressMng=function(page){
    page.houseKeeping();
    $(page).trigger({type:"composeAddressMng"});
  }
  
  window.wizard=Wizard;
  
  return Wizard;
})
